<?php
/*
php标准格式；
学习模板！
*/
header("content-type:text/html;charset=UTF-8");
//继承extends案例
class Student{
	public $name;
	public $age;
	protected $grade;
	public function __construct($name,$age)
	{
		$this->name = $name;
		$this->age = $age;
		//$this->grade = $grade;
	}
	public function setGrade($grade){
		$this->grade=$grade;
	}
}
//小学生类
class Pupil extends Student{
	public function tesing(){
		echo '小学生正在考试、考的是小学数学';
	}
}
//graduate大学生考试
class Graduate extends Student{
	public function tesing(){
		echo '大学生正在考试、考的是大学微积分';
	}
}
$Xsx = new Pupil('贾宝玉',20);
$Xsx->tesing();
?>